package com.appwoo.txtws.component;

import com.appwoo.txtws.bean.BookMenuBean;
import com.appwoo.txtws.bean.BookModuleBean;
import com.appwoo.txtws.bean.BookQuestionBean;
import com.appwoo.txtws.bean.BookQuestionRadioBean;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UnsupportedEncodingException;
import java.net.HttpURLConnection;
import java.net.MalformedURLException;
import java.net.URL;
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import org.apache.http.conn.ConnectTimeoutException;
import org.jdom.Attribute;
import org.jdom.Document;
import org.jdom.Element;
import org.jdom.JDOMException;
import org.jdom.input.SAXBuilder;
import org.jdom.output.Format;
import org.jdom.output.XMLOutputter;

public class BookHelper
{
  public static final int LEVEL_00 = 0;
  public static final int LEVEL_01 = 1;
  public static final int LEVEL_02 = 2;
  public HttpURLConnection connection = null;
  public InputStreamReader isr = null;

  private ArrayList<String> getModule(BookMenuBean paramBookMenuBean, String paramString)
    throws ConnectTimeoutException, FileNotFoundException, IOException
  {
    ArrayList localArrayList1 = new ArrayList();
    localArrayList1.add(paramBookMenuBean.getPath());
    ArrayList localArrayList2 = parseSyncTutorialBookModule(getWebResource(paramString + getEncodeURL(paramBookMenuBean.getPath())));
    String str = paramBookMenuBean.getPath().substring(0, 1 + paramBookMenuBean.getPath().lastIndexOf("/"));
    Iterator localIterator;
    if ((localArrayList2 != null) && (!localArrayList2.isEmpty()))
      localIterator = localArrayList2.iterator();
    while (true)
    {
      if (!localIterator.hasNext())
        return localArrayList1;
      BookModuleBean localBookModuleBean = (BookModuleBean)localIterator.next();
      localArrayList1.add(str + localBookModuleBean.getPath());
    }
  }

  private ArrayList<ArrayList<BookQuestionBean>> parseBookContentForQuestion(InputStreamReader paramInputStreamReader)
  {
    ArrayList localArrayList1 = new ArrayList();
    SAXBuilder localSAXBuilder = new SAXBuilder();
    while (true)
    {
      int i;
      try
      {
        List localList1 = localSAXBuilder.build(paramInputStreamReader).getRootElement().getChildren("question");
        if ((localList1 != null) && (!localList1.isEmpty()))
        {
          i = 0;
          int j = localList1.size();
          if (i >= j)
            return localArrayList1;
          List localList2 = ((Element)localList1.get(i)).getChildren("question");
          if ((localList2 == null) || (localList2.isEmpty()))
            break label425;
          ArrayList localArrayList2 = new ArrayList();
          int k = 0;
          int m = localList2.size();
          if (k >= m)
          {
            localArrayList1.add(localArrayList2);
            break label425;
          }
          BookQuestionBean localBookQuestionBean = new BookQuestionBean();
          Element localElement1 = (Element)localList2.get(k);
          Attribute localAttribute1 = localElement1.getAttribute("type");
          if (localAttribute1 != null)
            localBookQuestionBean.setType(localAttribute1.getIntValue());
          Element localElement2 = localElement1.getChild("content");
          if (localElement2 != null)
            localBookQuestionBean.setContent(localElement2.getValue());
          List localList3 = localElement1.getChildren("item");
          ArrayList localArrayList3;
          int n;
          if ((localList3 != null) && (!localList3.isEmpty()))
          {
            localArrayList3 = new ArrayList();
            n = 0;
            int i1 = localList3.size();
            if (n >= i1)
              localBookQuestionBean.setRadios(localArrayList3);
          }
          else
          {
            Element localElement3 = localElement1.getChild("answer");
            if (localElement3 != null)
              localBookQuestionBean.setAnswer(localElement3.getValue());
            Element localElement4 = localElement1.getChild("description");
            if (localElement4 != null)
              localBookQuestionBean.setDescription(localElement4.getValue());
            localArrayList2.add(localBookQuestionBean);
            k++;
            continue;
          }
          BookQuestionRadioBean localBookQuestionRadioBean = new BookQuestionRadioBean();
          Element localElement5 = (Element)localList3.get(n);
          if (localElement5 != null)
          {
            Attribute localAttribute2 = localElement5.getAttribute("name");
            if (localAttribute2 != null)
            {
              localBookQuestionRadioBean.setContent(localElement5.getValue());
              localBookQuestionRadioBean.setOption(localAttribute2.getValue());
              localArrayList3.add(localBookQuestionRadioBean);
            }
          }
          n++;
          continue;
        }
      }
      catch (JDOMException localJDOMException)
      {
        localJDOMException.printStackTrace();
        return localArrayList1;
      }
      catch (IOException localIOException)
      {
        localIOException.printStackTrace();
      }
      return localArrayList1;
      label425: i++;
    }
  }

  public void closeInputStreamReader()
  {
    if (this.isr != null);
    try
    {
      this.isr.close();
      return;
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
    }
  }

  public void deleteAllFile(File paramFile)
  {
    if ((paramFile == null) || (!paramFile.exists()))
      return;
    if (!paramFile.isDirectory())
    {
      paramFile.delete();
      return;
    }
    File[] arrayOfFile = paramFile.listFiles();
    if (arrayOfFile.length == 0)
    {
      paramFile.delete();
      return;
    }
    int i = arrayOfFile.length;
    for (int j = 0; ; j++)
    {
      if (j >= i)
      {
        paramFile.delete();
        return;
      }
      deleteAllFile(arrayOfFile[j]);
    }
  }

  public void disConnection()
  {
    if (this.connection != null)
      this.connection.disconnect();
  }

  // ERROR //
  public void downloadFile(String paramString1, String paramString2)
  {
    // Byte code:
    //   0: aconst_null
    //   1: astore_3
    //   2: aconst_null
    //   3: astore 4
    //   5: aconst_null
    //   6: astore 5
    //   8: new 209	java/io/File
    //   11: dup
    //   12: aload_2
    //   13: invokespecial 235	java/io/File:<init>	(Ljava/lang/String;)V
    //   16: astore 6
    //   18: aconst_null
    //   19: astore_3
    //   20: aconst_null
    //   21: astore 4
    //   23: aconst_null
    //   24: astore 5
    //   26: aload 6
    //   28: ifnull +15 -> 43
    //   31: aload 6
    //   33: invokevirtual 212	java/io/File:exists	()Z
    //   36: istore 16
    //   38: iload 16
    //   40: ifeq +46 -> 86
    //   43: iconst_0
    //   44: ifeq +7 -> 51
    //   47: aconst_null
    //   48: invokevirtual 238	java/io/FileOutputStream:close	()V
    //   51: iconst_0
    //   52: ifeq +7 -> 59
    //   55: aconst_null
    //   56: invokevirtual 230	java/net/HttpURLConnection:disconnect	()V
    //   59: iconst_0
    //   60: ifeq +7 -> 67
    //   63: aconst_null
    //   64: invokevirtual 241	java/io/InputStream:close	()V
    //   67: return
    //   68: astore 25
    //   70: aload 25
    //   72: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   75: goto -24 -> 51
    //   78: astore 24
    //   80: aload 24
    //   82: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   85: return
    //   86: aload 6
    //   88: invokevirtual 245	java/io/File:getParentFile	()Ljava/io/File;
    //   91: invokevirtual 212	java/io/File:exists	()Z
    //   94: istore 17
    //   96: aconst_null
    //   97: astore_3
    //   98: aconst_null
    //   99: astore 4
    //   101: aconst_null
    //   102: astore 5
    //   104: iload 17
    //   106: ifne +12 -> 118
    //   109: aload 6
    //   111: invokevirtual 245	java/io/File:getParentFile	()Ljava/io/File;
    //   114: invokevirtual 248	java/io/File:mkdirs	()Z
    //   117: pop
    //   118: new 250	java/net/URL
    //   121: dup
    //   122: aload_0
    //   123: aload_1
    //   124: invokevirtual 59	com/appwoo/txtws/component/BookHelper:getEncodeURL	(Ljava/lang/String;)Ljava/lang/String;
    //   127: invokespecial 251	java/net/URL:<init>	(Ljava/lang/String;)V
    //   130: invokevirtual 255	java/net/URL:openConnection	()Ljava/net/URLConnection;
    //   133: checkcast 227	java/net/HttpURLConnection
    //   136: astore 4
    //   138: aload 4
    //   140: sipush 5000
    //   143: invokevirtual 258	java/net/HttpURLConnection:setConnectTimeout	(I)V
    //   146: aload 4
    //   148: invokevirtual 262	java/net/HttpURLConnection:getInputStream	()Ljava/io/InputStream;
    //   151: astore 5
    //   153: new 237	java/io/FileOutputStream
    //   156: dup
    //   157: aload 6
    //   159: invokespecial 264	java/io/FileOutputStream:<init>	(Ljava/io/File;)V
    //   162: astore 19
    //   164: sipush 512
    //   167: newarray byte
    //   169: astore 20
    //   171: aload 5
    //   173: aload 20
    //   175: invokevirtual 268	java/io/InputStream:read	([B)I
    //   178: istore 21
    //   180: iload 21
    //   182: iconst_m1
    //   183: if_icmpne +39 -> 222
    //   186: aload 19
    //   188: invokevirtual 271	java/io/FileOutputStream:flush	()V
    //   191: aload 19
    //   193: ifnull +8 -> 201
    //   196: aload 19
    //   198: invokevirtual 238	java/io/FileOutputStream:close	()V
    //   201: aload 4
    //   203: ifnull +8 -> 211
    //   206: aload 4
    //   208: invokevirtual 230	java/net/HttpURLConnection:disconnect	()V
    //   211: aload 5
    //   213: ifnull +203 -> 416
    //   216: aload 5
    //   218: invokevirtual 241	java/io/InputStream:close	()V
    //   221: return
    //   222: aload 19
    //   224: aload 20
    //   226: iconst_0
    //   227: iload 21
    //   229: invokevirtual 275	java/io/FileOutputStream:write	([BII)V
    //   232: goto -61 -> 171
    //   235: astore 7
    //   237: aload 19
    //   239: astore_3
    //   240: aload 7
    //   242: invokevirtual 276	java/net/MalformedURLException:printStackTrace	()V
    //   245: aload_3
    //   246: ifnull +7 -> 253
    //   249: aload_3
    //   250: invokevirtual 238	java/io/FileOutputStream:close	()V
    //   253: aload 4
    //   255: ifnull +8 -> 263
    //   258: aload 4
    //   260: invokevirtual 230	java/net/HttpURLConnection:disconnect	()V
    //   263: aload 5
    //   265: ifnull -198 -> 67
    //   268: aload 5
    //   270: invokevirtual 241	java/io/InputStream:close	()V
    //   273: return
    //   274: astore 11
    //   276: aload 11
    //   278: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   281: return
    //   282: astore 12
    //   284: aload 12
    //   286: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   289: goto -36 -> 253
    //   292: astore 13
    //   294: aload 13
    //   296: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   299: aload_3
    //   300: ifnull +7 -> 307
    //   303: aload_3
    //   304: invokevirtual 238	java/io/FileOutputStream:close	()V
    //   307: aload 4
    //   309: ifnull +8 -> 317
    //   312: aload 4
    //   314: invokevirtual 230	java/net/HttpURLConnection:disconnect	()V
    //   317: aload 5
    //   319: ifnull -252 -> 67
    //   322: aload 5
    //   324: invokevirtual 241	java/io/InputStream:close	()V
    //   327: return
    //   328: astore 14
    //   330: aload 14
    //   332: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   335: return
    //   336: astore 15
    //   338: aload 15
    //   340: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   343: goto -36 -> 307
    //   346: astore 8
    //   348: aload_3
    //   349: ifnull +7 -> 356
    //   352: aload_3
    //   353: invokevirtual 238	java/io/FileOutputStream:close	()V
    //   356: aload 4
    //   358: ifnull +8 -> 366
    //   361: aload 4
    //   363: invokevirtual 230	java/net/HttpURLConnection:disconnect	()V
    //   366: aload 5
    //   368: ifnull +8 -> 376
    //   371: aload 5
    //   373: invokevirtual 241	java/io/InputStream:close	()V
    //   376: aload 8
    //   378: athrow
    //   379: astore 10
    //   381: aload 10
    //   383: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   386: goto -30 -> 356
    //   389: astore 9
    //   391: aload 9
    //   393: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   396: goto -20 -> 376
    //   399: astore 23
    //   401: aload 23
    //   403: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   406: goto -205 -> 201
    //   409: astore 22
    //   411: aload 22
    //   413: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   416: return
    //   417: astore 8
    //   419: aload 19
    //   421: astore_3
    //   422: goto -74 -> 348
    //   425: astore 13
    //   427: aload 19
    //   429: astore_3
    //   430: goto -136 -> 294
    //   433: astore 7
    //   435: aconst_null
    //   436: astore_3
    //   437: goto -197 -> 240
    //
    // Exception table:
    //   from	to	target	type
    //   47	51	68	java/io/IOException
    //   63	67	78	java/io/IOException
    //   164	171	235	java/net/MalformedURLException
    //   171	180	235	java/net/MalformedURLException
    //   186	191	235	java/net/MalformedURLException
    //   222	232	235	java/net/MalformedURLException
    //   268	273	274	java/io/IOException
    //   249	253	282	java/io/IOException
    //   8	18	292	java/io/IOException
    //   31	38	292	java/io/IOException
    //   86	96	292	java/io/IOException
    //   109	118	292	java/io/IOException
    //   118	164	292	java/io/IOException
    //   322	327	328	java/io/IOException
    //   303	307	336	java/io/IOException
    //   8	18	346	finally
    //   31	38	346	finally
    //   86	96	346	finally
    //   109	118	346	finally
    //   118	164	346	finally
    //   240	245	346	finally
    //   294	299	346	finally
    //   352	356	379	java/io/IOException
    //   371	376	389	java/io/IOException
    //   196	201	399	java/io/IOException
    //   216	221	409	java/io/IOException
    //   164	171	417	finally
    //   171	180	417	finally
    //   186	191	417	finally
    //   222	232	417	finally
    //   164	171	425	java/io/IOException
    //   171	180	425	java/io/IOException
    //   186	191	425	java/io/IOException
    //   222	232	425	java/io/IOException
    //   8	18	433	java/net/MalformedURLException
    //   31	38	433	java/net/MalformedURLException
    //   86	96	433	java/net/MalformedURLException
    //   109	118	433	java/net/MalformedURLException
    //   118	164	433	java/net/MalformedURLException
  }

  // ERROR //
  public ArrayList<ArrayList<BookQuestionBean>> getBookContentForQuestion(String paramString)
  {
    // Byte code:
    //   0: new 33	java/util/ArrayList
    //   3: dup
    //   4: invokespecial 34	java/util/ArrayList:<init>	()V
    //   7: astore_2
    //   8: aload_1
    //   9: ifnull +13 -> 22
    //   12: ldc_w 282
    //   15: aload_1
    //   16: invokevirtual 285	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   19: ifeq +5 -> 24
    //   22: aload_2
    //   23: areturn
    //   24: new 209	java/io/File
    //   27: dup
    //   28: aload_1
    //   29: invokespecial 235	java/io/File:<init>	(Ljava/lang/String;)V
    //   32: astore_3
    //   33: aload_3
    //   34: ifnull +10 -> 44
    //   37: aload_3
    //   38: invokevirtual 212	java/io/File:exists	()Z
    //   41: ifne +5 -> 46
    //   44: aload_2
    //   45: areturn
    //   46: aconst_null
    //   47: astore 4
    //   49: aconst_null
    //   50: astore 5
    //   52: new 287	java/io/FileInputStream
    //   55: dup
    //   56: aload_3
    //   57: invokespecial 288	java/io/FileInputStream:<init>	(Ljava/io/File;)V
    //   60: astore 6
    //   62: new 202	java/io/InputStreamReader
    //   65: dup
    //   66: aload 6
    //   68: ldc_w 290
    //   71: invokespecial 293	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;Ljava/lang/String;)V
    //   74: astore 7
    //   76: aload_0
    //   77: aload 7
    //   79: invokespecial 295	com/appwoo/txtws/component/BookHelper:parseBookContentForQuestion	(Ljava/io/InputStreamReader;)Ljava/util/ArrayList;
    //   82: astore 17
    //   84: aload 17
    //   86: astore_2
    //   87: aload 6
    //   89: ifnull +8 -> 97
    //   92: aload 6
    //   94: invokevirtual 296	java/io/FileInputStream:close	()V
    //   97: aload 7
    //   99: ifnull +172 -> 271
    //   102: aload 7
    //   104: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   107: aload_2
    //   108: areturn
    //   109: astore 8
    //   111: aload 8
    //   113: invokevirtual 297	java/io/FileNotFoundException:printStackTrace	()V
    //   116: aload 4
    //   118: ifnull +8 -> 126
    //   121: aload 4
    //   123: invokevirtual 296	java/io/FileInputStream:close	()V
    //   126: aload 5
    //   128: ifnull -21 -> 107
    //   131: aload 5
    //   133: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   136: goto -29 -> 107
    //   139: astore 12
    //   141: aload 12
    //   143: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   146: goto -39 -> 107
    //   149: astore 13
    //   151: aload 13
    //   153: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   156: goto -30 -> 126
    //   159: astore 14
    //   161: aload 14
    //   163: invokevirtual 298	java/io/UnsupportedEncodingException:printStackTrace	()V
    //   166: aload 4
    //   168: ifnull +8 -> 176
    //   171: aload 4
    //   173: invokevirtual 296	java/io/FileInputStream:close	()V
    //   176: aload 5
    //   178: ifnull -71 -> 107
    //   181: aload 5
    //   183: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   186: goto -79 -> 107
    //   189: astore 15
    //   191: aload 15
    //   193: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   196: goto -89 -> 107
    //   199: astore 16
    //   201: aload 16
    //   203: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   206: goto -30 -> 176
    //   209: astore 9
    //   211: aload 4
    //   213: ifnull +8 -> 221
    //   216: aload 4
    //   218: invokevirtual 296	java/io/FileInputStream:close	()V
    //   221: aload 5
    //   223: ifnull +8 -> 231
    //   226: aload 5
    //   228: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   231: aload 9
    //   233: athrow
    //   234: astore 11
    //   236: aload 11
    //   238: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   241: goto -20 -> 221
    //   244: astore 10
    //   246: aload 10
    //   248: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   251: goto -20 -> 231
    //   254: astore 19
    //   256: aload 19
    //   258: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   261: goto -164 -> 97
    //   264: astore 18
    //   266: aload 18
    //   268: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   271: goto -164 -> 107
    //   274: astore 9
    //   276: aload 6
    //   278: astore 4
    //   280: aconst_null
    //   281: astore 5
    //   283: goto -72 -> 211
    //   286: astore 9
    //   288: aload 7
    //   290: astore 5
    //   292: aload 6
    //   294: astore 4
    //   296: goto -85 -> 211
    //   299: astore 14
    //   301: aload 6
    //   303: astore 4
    //   305: aconst_null
    //   306: astore 5
    //   308: goto -147 -> 161
    //   311: astore 14
    //   313: aload 7
    //   315: astore 5
    //   317: aload 6
    //   319: astore 4
    //   321: goto -160 -> 161
    //   324: astore 8
    //   326: aload 6
    //   328: astore 4
    //   330: aconst_null
    //   331: astore 5
    //   333: goto -222 -> 111
    //   336: astore 8
    //   338: aload 7
    //   340: astore 5
    //   342: aload 6
    //   344: astore 4
    //   346: goto -235 -> 111
    //
    // Exception table:
    //   from	to	target	type
    //   52	62	109	java/io/FileNotFoundException
    //   131	136	139	java/io/IOException
    //   121	126	149	java/io/IOException
    //   52	62	159	java/io/UnsupportedEncodingException
    //   181	186	189	java/io/IOException
    //   171	176	199	java/io/IOException
    //   52	62	209	finally
    //   111	116	209	finally
    //   161	166	209	finally
    //   216	221	234	java/io/IOException
    //   226	231	244	java/io/IOException
    //   92	97	254	java/io/IOException
    //   102	107	264	java/io/IOException
    //   62	76	274	finally
    //   76	84	286	finally
    //   62	76	299	java/io/UnsupportedEncodingException
    //   76	84	311	java/io/UnsupportedEncodingException
    //   62	76	324	java/io/FileNotFoundException
    //   76	84	336	java/io/FileNotFoundException
  }

  // ERROR //
  public ArrayList<BookQuestionBean> getBookContentForQuestion2(String paramString)
  {
    // Byte code:
    //   0: new 33	java/util/ArrayList
    //   3: dup
    //   4: invokespecial 34	java/util/ArrayList:<init>	()V
    //   7: astore_2
    //   8: aload_1
    //   9: ifnull +13 -> 22
    //   12: ldc_w 282
    //   15: aload_1
    //   16: invokevirtual 285	java/lang/String:equals	(Ljava/lang/Object;)Z
    //   19: ifeq +5 -> 24
    //   22: aload_2
    //   23: areturn
    //   24: new 209	java/io/File
    //   27: dup
    //   28: aload_1
    //   29: invokespecial 235	java/io/File:<init>	(Ljava/lang/String;)V
    //   32: astore_3
    //   33: aload_3
    //   34: ifnull +10 -> 44
    //   37: aload_3
    //   38: invokevirtual 212	java/io/File:exists	()Z
    //   41: ifne +5 -> 46
    //   44: aload_2
    //   45: areturn
    //   46: aconst_null
    //   47: astore 4
    //   49: aconst_null
    //   50: astore 5
    //   52: new 287	java/io/FileInputStream
    //   55: dup
    //   56: aload_3
    //   57: invokespecial 288	java/io/FileInputStream:<init>	(Ljava/io/File;)V
    //   60: astore 6
    //   62: new 202	java/io/InputStreamReader
    //   65: dup
    //   66: aload 6
    //   68: ldc_w 290
    //   71: invokespecial 293	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;Ljava/lang/String;)V
    //   74: astore 7
    //   76: aload_0
    //   77: aload 7
    //   79: invokevirtual 302	com/appwoo/txtws/component/BookHelper:parseBookContentForQuestion2	(Ljava/io/InputStreamReader;)Ljava/util/ArrayList;
    //   82: astore 17
    //   84: aload 17
    //   86: astore_2
    //   87: aload 6
    //   89: ifnull +8 -> 97
    //   92: aload 6
    //   94: invokevirtual 296	java/io/FileInputStream:close	()V
    //   97: aload 7
    //   99: ifnull +172 -> 271
    //   102: aload 7
    //   104: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   107: aload_2
    //   108: areturn
    //   109: astore 8
    //   111: aload 8
    //   113: invokevirtual 297	java/io/FileNotFoundException:printStackTrace	()V
    //   116: aload 4
    //   118: ifnull +8 -> 126
    //   121: aload 4
    //   123: invokevirtual 296	java/io/FileInputStream:close	()V
    //   126: aload 5
    //   128: ifnull -21 -> 107
    //   131: aload 5
    //   133: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   136: goto -29 -> 107
    //   139: astore 12
    //   141: aload 12
    //   143: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   146: goto -39 -> 107
    //   149: astore 13
    //   151: aload 13
    //   153: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   156: goto -30 -> 126
    //   159: astore 14
    //   161: aload 14
    //   163: invokevirtual 298	java/io/UnsupportedEncodingException:printStackTrace	()V
    //   166: aload 4
    //   168: ifnull +8 -> 176
    //   171: aload 4
    //   173: invokevirtual 296	java/io/FileInputStream:close	()V
    //   176: aload 5
    //   178: ifnull -71 -> 107
    //   181: aload 5
    //   183: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   186: goto -79 -> 107
    //   189: astore 15
    //   191: aload 15
    //   193: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   196: goto -89 -> 107
    //   199: astore 16
    //   201: aload 16
    //   203: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   206: goto -30 -> 176
    //   209: astore 9
    //   211: aload 4
    //   213: ifnull +8 -> 221
    //   216: aload 4
    //   218: invokevirtual 296	java/io/FileInputStream:close	()V
    //   221: aload 5
    //   223: ifnull +8 -> 231
    //   226: aload 5
    //   228: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   231: aload 9
    //   233: athrow
    //   234: astore 11
    //   236: aload 11
    //   238: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   241: goto -20 -> 221
    //   244: astore 10
    //   246: aload 10
    //   248: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   251: goto -20 -> 231
    //   254: astore 19
    //   256: aload 19
    //   258: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   261: goto -164 -> 97
    //   264: astore 18
    //   266: aload 18
    //   268: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   271: goto -164 -> 107
    //   274: astore 9
    //   276: aload 6
    //   278: astore 4
    //   280: aconst_null
    //   281: astore 5
    //   283: goto -72 -> 211
    //   286: astore 9
    //   288: aload 7
    //   290: astore 5
    //   292: aload 6
    //   294: astore 4
    //   296: goto -85 -> 211
    //   299: astore 14
    //   301: aload 6
    //   303: astore 4
    //   305: aconst_null
    //   306: astore 5
    //   308: goto -147 -> 161
    //   311: astore 14
    //   313: aload 7
    //   315: astore 5
    //   317: aload 6
    //   319: astore 4
    //   321: goto -160 -> 161
    //   324: astore 8
    //   326: aload 6
    //   328: astore 4
    //   330: aconst_null
    //   331: astore 5
    //   333: goto -222 -> 111
    //   336: astore 8
    //   338: aload 7
    //   340: astore 5
    //   342: aload 6
    //   344: astore 4
    //   346: goto -235 -> 111
    //
    // Exception table:
    //   from	to	target	type
    //   52	62	109	java/io/FileNotFoundException
    //   131	136	139	java/io/IOException
    //   121	126	149	java/io/IOException
    //   52	62	159	java/io/UnsupportedEncodingException
    //   181	186	189	java/io/IOException
    //   171	176	199	java/io/IOException
    //   52	62	209	finally
    //   111	116	209	finally
    //   161	166	209	finally
    //   216	221	234	java/io/IOException
    //   226	231	244	java/io/IOException
    //   92	97	254	java/io/IOException
    //   102	107	264	java/io/IOException
    //   62	76	274	finally
    //   76	84	286	finally
    //   62	76	299	java/io/UnsupportedEncodingException
    //   76	84	311	java/io/UnsupportedEncodingException
    //   62	76	324	java/io/FileNotFoundException
    //   76	84	336	java/io/FileNotFoundException
  }

  public String getEncodeURL(String paramString)
  {
    if ((paramString != null) && (!"".equals(paramString)))
    {
      String str = paramString.replace("\\", "/");
      String[] arrayOfString = str.split("/");
      StringBuilder localStringBuilder = new StringBuilder();
      boolean bool = str.startsWith("http");
      int i = 0;
      if (bool)
        i = 1;
      int j = 0;
      if (j >= arrayOfString.length)
        return localStringBuilder.toString().replace("+", "%20");
      if ((i != 0) && (j < 3))
      {
        localStringBuilder.append(arrayOfString[j]);
        localStringBuilder.append("/");
      }
      while (true)
      {
        j++;
        break;
        try
        {
          localStringBuilder.append(URLEncoder.encode(arrayOfString[j], "UTF-8"));
          if (j < -1 + arrayOfString.length)
            localStringBuilder.append("/");
        }
        catch (UnsupportedEncodingException localUnsupportedEncodingException)
        {
          localUnsupportedEncodingException.printStackTrace();
        }
      }
    }
    return paramString;
  }

  public ArrayList<String> getSignleBookDownloadFileList(String paramString)
    throws ConnectTimeoutException, FileNotFoundException, IOException
  {
    ArrayList localArrayList1 = new ArrayList();
    String str;
    Iterator localIterator1;
    if ((paramString != null) && (!"".equals(paramString)))
    {
      str = getEncodeURL(paramString);
      if (!str.endsWith("/"))
        str = str + "/";
      ArrayList localArrayList2 = parseSyncTutorialBookMenu(getWebResource(str + "index.xml"));
      if ((localArrayList2 != null) && (!localArrayList2.isEmpty()))
        localIterator1 = localArrayList2.iterator();
    }
    while (true)
    {
      if (!localIterator1.hasNext())
      {
        localArrayList1.add("index.xml");
        return localArrayList1;
      }
      BookMenuBean localBookMenuBean = (BookMenuBean)localIterator1.next();
      if (localBookMenuBean.getPath() != null)
        localArrayList1.addAll(getModule(localBookMenuBean, str));
      ArrayList localArrayList3 = localBookMenuBean.getMenus();
      if ((localArrayList3 != null) && (!localArrayList3.isEmpty()))
      {
        Iterator localIterator2 = localArrayList3.iterator();
        while (localIterator2.hasNext())
          localArrayList1.addAll(getModule((BookMenuBean)localIterator2.next(), str));
      }
    }
  }

  public void getSyncTutorialBookBySubject(String paramString)
  {
    File localFile = new File(Global.BOOK_PATH);
    if ((localFile == null) || (!localFile.exists()));
    File[] arrayOfFile;
    do
    {
      return;
      arrayOfFile = localFile.listFiles();
    }
    while ((arrayOfFile == null) || (arrayOfFile.length != 0));
  }

  // ERROR //
  public String getSyncTutorialBookContent(String paramString)
  {
    // Byte code:
    //   0: new 209	java/io/File
    //   3: dup
    //   4: aload_1
    //   5: invokespecial 235	java/io/File:<init>	(Ljava/lang/String;)V
    //   8: astore_2
    //   9: aload_2
    //   10: ifnull +109 -> 119
    //   13: aload_2
    //   14: invokevirtual 212	java/io/File:exists	()Z
    //   17: ifeq +102 -> 119
    //   20: aconst_null
    //   21: astore_3
    //   22: new 360	java/io/BufferedReader
    //   25: dup
    //   26: new 202	java/io/InputStreamReader
    //   29: dup
    //   30: new 287	java/io/FileInputStream
    //   33: dup
    //   34: aload_2
    //   35: invokespecial 288	java/io/FileInputStream:<init>	(Ljava/io/File;)V
    //   38: ldc_w 362
    //   41: invokespecial 293	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;Ljava/lang/String;)V
    //   44: invokespecial 365	java/io/BufferedReader:<init>	(Ljava/io/Reader;)V
    //   47: astore 4
    //   49: new 367	java/lang/StringBuffer
    //   52: dup
    //   53: invokespecial 368	java/lang/StringBuffer:<init>	()V
    //   56: astore 5
    //   58: aload 4
    //   60: invokevirtual 371	java/io/BufferedReader:readLine	()Ljava/lang/String;
    //   63: astore 12
    //   65: aload 12
    //   67: ifnonnull +23 -> 90
    //   70: aload 5
    //   72: invokevirtual 372	java/lang/StringBuffer:toString	()Ljava/lang/String;
    //   75: astore 13
    //   77: aload 4
    //   79: ifnull +8 -> 87
    //   82: aload 4
    //   84: invokevirtual 373	java/io/BufferedReader:close	()V
    //   87: aload 13
    //   89: areturn
    //   90: aload 5
    //   92: aload 12
    //   94: invokevirtual 376	java/lang/StringBuffer:append	(Ljava/lang/String;)Ljava/lang/StringBuffer;
    //   97: pop
    //   98: goto -40 -> 58
    //   101: astore 10
    //   103: aload 4
    //   105: astore_3
    //   106: aload 10
    //   108: invokevirtual 297	java/io/FileNotFoundException:printStackTrace	()V
    //   111: aload_3
    //   112: ifnull +7 -> 119
    //   115: aload_3
    //   116: invokevirtual 373	java/io/BufferedReader:close	()V
    //   119: aconst_null
    //   120: areturn
    //   121: astore 14
    //   123: aload 14
    //   125: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   128: aload 13
    //   130: areturn
    //   131: astore 11
    //   133: aload 11
    //   135: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   138: goto -19 -> 119
    //   141: astore 16
    //   143: aload_3
    //   144: ifnull -25 -> 119
    //   147: aload_3
    //   148: invokevirtual 373	java/io/BufferedReader:close	()V
    //   151: goto -32 -> 119
    //   154: astore 7
    //   156: aload 7
    //   158: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   161: goto -42 -> 119
    //   164: astore 8
    //   166: aload_3
    //   167: ifnull +7 -> 174
    //   170: aload_3
    //   171: invokevirtual 373	java/io/BufferedReader:close	()V
    //   174: aload 8
    //   176: athrow
    //   177: astore 9
    //   179: aload 9
    //   181: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   184: goto -10 -> 174
    //   187: astore 8
    //   189: aload 4
    //   191: astore_3
    //   192: goto -26 -> 166
    //   195: astore 6
    //   197: aload 4
    //   199: astore_3
    //   200: goto -57 -> 143
    //   203: astore 10
    //   205: aconst_null
    //   206: astore_3
    //   207: goto -101 -> 106
    //
    // Exception table:
    //   from	to	target	type
    //   49	58	101	java/io/FileNotFoundException
    //   58	65	101	java/io/FileNotFoundException
    //   70	77	101	java/io/FileNotFoundException
    //   90	98	101	java/io/FileNotFoundException
    //   82	87	121	java/io/IOException
    //   115	119	131	java/io/IOException
    //   22	49	141	java/io/IOException
    //   147	151	154	java/io/IOException
    //   22	49	164	finally
    //   106	111	164	finally
    //   170	174	177	java/io/IOException
    //   49	58	187	finally
    //   58	65	187	finally
    //   70	77	187	finally
    //   90	98	187	finally
    //   49	58	195	java/io/IOException
    //   58	65	195	java/io/IOException
    //   70	77	195	java/io/IOException
    //   90	98	195	java/io/IOException
    //   22	49	203	java/io/FileNotFoundException
  }

  // ERROR //
  public ArrayList<BookMenuBean> getSyncTutorialBookMenuByName(String paramString)
  {
    // Byte code:
    //   0: new 33	java/util/ArrayList
    //   3: dup
    //   4: invokespecial 34	java/util/ArrayList:<init>	()V
    //   7: astore_2
    //   8: new 209	java/io/File
    //   11: dup
    //   12: aload_1
    //   13: invokespecial 235	java/io/File:<init>	(Ljava/lang/String;)V
    //   16: astore_3
    //   17: aload_3
    //   18: ifnull +71 -> 89
    //   21: aload_3
    //   22: invokevirtual 212	java/io/File:exists	()Z
    //   25: ifeq +64 -> 89
    //   28: aconst_null
    //   29: astore 4
    //   31: aconst_null
    //   32: astore 5
    //   34: new 287	java/io/FileInputStream
    //   37: dup
    //   38: aload_3
    //   39: invokespecial 288	java/io/FileInputStream:<init>	(Ljava/io/File;)V
    //   42: astore 6
    //   44: new 202	java/io/InputStreamReader
    //   47: dup
    //   48: aload 6
    //   50: ldc_w 290
    //   53: invokespecial 293	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;Ljava/lang/String;)V
    //   56: astore 7
    //   58: aload_0
    //   59: aload 7
    //   61: invokevirtual 340	com/appwoo/txtws/component/BookHelper:parseSyncTutorialBookMenu	(Ljava/io/InputStreamReader;)Ljava/util/ArrayList;
    //   64: astore 17
    //   66: aload 17
    //   68: astore_2
    //   69: aload 6
    //   71: ifnull +8 -> 79
    //   74: aload 6
    //   76: invokevirtual 296	java/io/FileInputStream:close	()V
    //   79: aload 7
    //   81: ifnull +8 -> 89
    //   84: aload 7
    //   86: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   89: aload_2
    //   90: areturn
    //   91: astore 8
    //   93: aload 8
    //   95: invokevirtual 297	java/io/FileNotFoundException:printStackTrace	()V
    //   98: aload 4
    //   100: ifnull +8 -> 108
    //   103: aload 4
    //   105: invokevirtual 296	java/io/FileInputStream:close	()V
    //   108: aload 5
    //   110: ifnull -21 -> 89
    //   113: aload 5
    //   115: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   118: aload_2
    //   119: areturn
    //   120: astore 12
    //   122: aload 12
    //   124: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   127: aload_2
    //   128: areturn
    //   129: astore 13
    //   131: aload 13
    //   133: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   136: goto -28 -> 108
    //   139: astore 14
    //   141: aload 14
    //   143: invokevirtual 298	java/io/UnsupportedEncodingException:printStackTrace	()V
    //   146: aload 4
    //   148: ifnull +8 -> 156
    //   151: aload 4
    //   153: invokevirtual 296	java/io/FileInputStream:close	()V
    //   156: aload 5
    //   158: ifnull -69 -> 89
    //   161: aload 5
    //   163: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   166: aload_2
    //   167: areturn
    //   168: astore 15
    //   170: aload 15
    //   172: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   175: aload_2
    //   176: areturn
    //   177: astore 16
    //   179: aload 16
    //   181: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   184: goto -28 -> 156
    //   187: astore 9
    //   189: aload 4
    //   191: ifnull +8 -> 199
    //   194: aload 4
    //   196: invokevirtual 296	java/io/FileInputStream:close	()V
    //   199: aload 5
    //   201: ifnull +8 -> 209
    //   204: aload 5
    //   206: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   209: aload 9
    //   211: athrow
    //   212: astore 11
    //   214: aload 11
    //   216: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   219: goto -20 -> 199
    //   222: astore 10
    //   224: aload 10
    //   226: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   229: goto -20 -> 209
    //   232: astore 19
    //   234: aload 19
    //   236: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   239: goto -160 -> 79
    //   242: astore 18
    //   244: aload 18
    //   246: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   249: aload_2
    //   250: areturn
    //   251: astore 9
    //   253: aload 6
    //   255: astore 4
    //   257: aconst_null
    //   258: astore 5
    //   260: goto -71 -> 189
    //   263: astore 9
    //   265: aload 7
    //   267: astore 5
    //   269: aload 6
    //   271: astore 4
    //   273: goto -84 -> 189
    //   276: astore 14
    //   278: aload 6
    //   280: astore 4
    //   282: aconst_null
    //   283: astore 5
    //   285: goto -144 -> 141
    //   288: astore 14
    //   290: aload 7
    //   292: astore 5
    //   294: aload 6
    //   296: astore 4
    //   298: goto -157 -> 141
    //   301: astore 8
    //   303: aload 6
    //   305: astore 4
    //   307: aconst_null
    //   308: astore 5
    //   310: goto -217 -> 93
    //   313: astore 8
    //   315: aload 7
    //   317: astore 5
    //   319: aload 6
    //   321: astore 4
    //   323: goto -230 -> 93
    //
    // Exception table:
    //   from	to	target	type
    //   34	44	91	java/io/FileNotFoundException
    //   113	118	120	java/io/IOException
    //   103	108	129	java/io/IOException
    //   34	44	139	java/io/UnsupportedEncodingException
    //   161	166	168	java/io/IOException
    //   151	156	177	java/io/IOException
    //   34	44	187	finally
    //   93	98	187	finally
    //   141	146	187	finally
    //   194	199	212	java/io/IOException
    //   204	209	222	java/io/IOException
    //   74	79	232	java/io/IOException
    //   84	89	242	java/io/IOException
    //   44	58	251	finally
    //   58	66	263	finally
    //   44	58	276	java/io/UnsupportedEncodingException
    //   58	66	288	java/io/UnsupportedEncodingException
    //   44	58	301	java/io/FileNotFoundException
    //   58	66	313	java/io/FileNotFoundException
  }

  // ERROR //
  public ArrayList<BookModuleBean> getSyncTutorialBookModel(String paramString)
  {
    // Byte code:
    //   0: new 33	java/util/ArrayList
    //   3: dup
    //   4: invokespecial 34	java/util/ArrayList:<init>	()V
    //   7: astore_2
    //   8: new 209	java/io/File
    //   11: dup
    //   12: aload_1
    //   13: invokespecial 235	java/io/File:<init>	(Ljava/lang/String;)V
    //   16: astore_3
    //   17: aload_3
    //   18: ifnull +71 -> 89
    //   21: aload_3
    //   22: invokevirtual 212	java/io/File:exists	()Z
    //   25: ifeq +64 -> 89
    //   28: aconst_null
    //   29: astore 4
    //   31: aconst_null
    //   32: astore 5
    //   34: new 287	java/io/FileInputStream
    //   37: dup
    //   38: aload_3
    //   39: invokespecial 288	java/io/FileInputStream:<init>	(Ljava/io/File;)V
    //   42: astore 6
    //   44: new 202	java/io/InputStreamReader
    //   47: dup
    //   48: aload 6
    //   50: ldc_w 290
    //   53: invokespecial 293	java/io/InputStreamReader:<init>	(Ljava/io/InputStream;Ljava/lang/String;)V
    //   56: astore 7
    //   58: aload_0
    //   59: aload 7
    //   61: invokevirtual 74	com/appwoo/txtws/component/BookHelper:parseSyncTutorialBookModule	(Ljava/io/InputStreamReader;)Ljava/util/ArrayList;
    //   64: astore 17
    //   66: aload 17
    //   68: astore_2
    //   69: aload 6
    //   71: ifnull +8 -> 79
    //   74: aload 6
    //   76: invokevirtual 296	java/io/FileInputStream:close	()V
    //   79: aload 7
    //   81: ifnull +8 -> 89
    //   84: aload 7
    //   86: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   89: aload_2
    //   90: areturn
    //   91: astore 8
    //   93: aload 8
    //   95: invokevirtual 297	java/io/FileNotFoundException:printStackTrace	()V
    //   98: aload 4
    //   100: ifnull +8 -> 108
    //   103: aload 4
    //   105: invokevirtual 296	java/io/FileInputStream:close	()V
    //   108: aload 5
    //   110: ifnull -21 -> 89
    //   113: aload 5
    //   115: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   118: aload_2
    //   119: areturn
    //   120: astore 12
    //   122: aload 12
    //   124: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   127: aload_2
    //   128: areturn
    //   129: astore 13
    //   131: aload 13
    //   133: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   136: goto -28 -> 108
    //   139: astore 14
    //   141: aload 14
    //   143: invokevirtual 298	java/io/UnsupportedEncodingException:printStackTrace	()V
    //   146: aload 4
    //   148: ifnull +8 -> 156
    //   151: aload 4
    //   153: invokevirtual 296	java/io/FileInputStream:close	()V
    //   156: aload 5
    //   158: ifnull -69 -> 89
    //   161: aload 5
    //   163: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   166: aload_2
    //   167: areturn
    //   168: astore 15
    //   170: aload 15
    //   172: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   175: aload_2
    //   176: areturn
    //   177: astore 16
    //   179: aload 16
    //   181: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   184: goto -28 -> 156
    //   187: astore 9
    //   189: aload 4
    //   191: ifnull +8 -> 199
    //   194: aload 4
    //   196: invokevirtual 296	java/io/FileInputStream:close	()V
    //   199: aload 5
    //   201: ifnull +8 -> 209
    //   204: aload 5
    //   206: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   209: aload 9
    //   211: athrow
    //   212: astore 11
    //   214: aload 11
    //   216: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   219: goto -20 -> 199
    //   222: astore 10
    //   224: aload 10
    //   226: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   229: goto -20 -> 209
    //   232: astore 19
    //   234: aload 19
    //   236: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   239: goto -160 -> 79
    //   242: astore 18
    //   244: aload 18
    //   246: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   249: aload_2
    //   250: areturn
    //   251: astore 9
    //   253: aload 6
    //   255: astore 4
    //   257: aconst_null
    //   258: astore 5
    //   260: goto -71 -> 189
    //   263: astore 9
    //   265: aload 7
    //   267: astore 5
    //   269: aload 6
    //   271: astore 4
    //   273: goto -84 -> 189
    //   276: astore 14
    //   278: aload 6
    //   280: astore 4
    //   282: aconst_null
    //   283: astore 5
    //   285: goto -144 -> 141
    //   288: astore 14
    //   290: aload 7
    //   292: astore 5
    //   294: aload 6
    //   296: astore 4
    //   298: goto -157 -> 141
    //   301: astore 8
    //   303: aload 6
    //   305: astore 4
    //   307: aconst_null
    //   308: astore 5
    //   310: goto -217 -> 93
    //   313: astore 8
    //   315: aload 7
    //   317: astore 5
    //   319: aload 6
    //   321: astore 4
    //   323: goto -230 -> 93
    //
    // Exception table:
    //   from	to	target	type
    //   34	44	91	java/io/FileNotFoundException
    //   113	118	120	java/io/IOException
    //   103	108	129	java/io/IOException
    //   34	44	139	java/io/UnsupportedEncodingException
    //   161	166	168	java/io/IOException
    //   151	156	177	java/io/IOException
    //   34	44	187	finally
    //   93	98	187	finally
    //   141	146	187	finally
    //   194	199	212	java/io/IOException
    //   204	209	222	java/io/IOException
    //   74	79	232	java/io/IOException
    //   84	89	242	java/io/IOException
    //   44	58	251	finally
    //   58	66	263	finally
    //   44	58	276	java/io/UnsupportedEncodingException
    //   58	66	288	java/io/UnsupportedEncodingException
    //   44	58	301	java/io/FileNotFoundException
    //   58	66	313	java/io/FileNotFoundException
  }

  public InputStreamReader getWebResource(String paramString)
    throws ConnectTimeoutException, FileNotFoundException, IOException
  {
    try
    {
      HttpURLConnection localHttpURLConnection = (HttpURLConnection)new URL(paramString).openConnection();
      localHttpURLConnection.setConnectTimeout(5000);
      InputStream localInputStream = localHttpURLConnection.getInputStream();
      int i = localHttpURLConnection.getResponseCode();
      Object localObject = null;
      if (i == 200)
      {
        InputStreamReader localInputStreamReader = new InputStreamReader(localInputStream, "GBK");
        localObject = localInputStreamReader;
      }
      return localObject;
    }
    catch (MalformedURLException localMalformedURLException)
    {
      localMalformedURLException.printStackTrace();
      return null;
    }
    catch (UnsupportedEncodingException localUnsupportedEncodingException)
    {
      localUnsupportedEncodingException.printStackTrace();
    }
    return null;
  }

  public ArrayList<BookQuestionBean> parseBookContentForQuestion2(InputStreamReader paramInputStreamReader)
  {
    XMLOutputter localXMLOutputter = new XMLOutputter(Format.getRawFormat());
    ArrayList localArrayList1 = new ArrayList();
    SAXBuilder localSAXBuilder = new SAXBuilder();
    while (true)
    {
      int i;
      try
      {
        List localList1 = localSAXBuilder.build(paramInputStreamReader).getRootElement().getChildren("question");
        if ((localList1 != null) && (!localList1.isEmpty()))
        {
          i = 0;
          int j = localList1.size();
          if (i >= j)
            return localArrayList1;
          List localList2 = ((Element)localList1.get(i)).getChildren("question");
          if ((localList2 == null) || (localList2.isEmpty()))
            break label515;
          int k = 0;
          int m = localList2.size();
          if (k >= m)
            break label515;
          BookQuestionBean localBookQuestionBean = new BookQuestionBean();
          Element localElement1 = (Element)localList2.get(k);
          Attribute localAttribute1 = localElement1.getAttribute("type");
          if (localAttribute1 != null)
            localBookQuestionBean.setType(localAttribute1.getIntValue());
          Element localElement2 = localElement1.getChild("content");
          if (localElement2 != null)
          {
            String str1 = localXMLOutputter.outputString(localElement2);
            if (str1 != null)
              str1.replace("<content>", "").replace("</content>", "");
            localBookQuestionBean.setContent(str1);
          }
          List localList3 = localElement1.getChildren("item");
          ArrayList localArrayList2;
          int n;
          if ((localList3 != null) && (!localList3.isEmpty()))
          {
            localArrayList2 = new ArrayList();
            n = 0;
            int i1 = localList3.size();
            if (n >= i1)
              localBookQuestionBean.setRadios(localArrayList2);
          }
          else
          {
            Element localElement3 = localElement1.getChild("answer");
            if (localElement3 != null)
            {
              String str2 = localXMLOutputter.outputString(localElement3);
              if (str2 != null)
                str2 = str2.replace("<answer>", "").replace("</answer>", "");
              localBookQuestionBean.setAnswer(str2);
            }
            Element localElement4 = localElement1.getChild("description");
            if (localElement4 != null)
              localBookQuestionBean.setDescription(localElement4.getValue());
            localArrayList1.add(localBookQuestionBean);
            k++;
            continue;
          }
          BookQuestionRadioBean localBookQuestionRadioBean = new BookQuestionRadioBean();
          Element localElement5 = (Element)localList3.get(n);
          if (localElement5 != null)
          {
            Attribute localAttribute2 = localElement5.getAttribute("name");
            if (localAttribute2 != null)
            {
              String str3 = localXMLOutputter.outputString(localElement5);
              if (str3 != null)
                str3.replaceAll("<item name=([^>]+)>", "").replace("</item>", "");
              localBookQuestionRadioBean.setContent(str3);
              localBookQuestionRadioBean.setOption(localAttribute2.getValue());
              localArrayList2.add(localBookQuestionRadioBean);
            }
          }
          n++;
          continue;
        }
      }
      catch (JDOMException localJDOMException)
      {
        localJDOMException.printStackTrace();
        return localArrayList1;
      }
      catch (IOException localIOException)
      {
        localIOException.printStackTrace();
      }
      return localArrayList1;
      label515: i++;
    }
  }

  public ArrayList<BookQuestionBean> parseBookContentForQuestion3(String paramString)
  {
    new ArrayList();
    InputStreamReader localInputStreamReader = new InputStreamReader(new ByteArrayInputStream(paramString.getBytes()));
    ArrayList localArrayList = parseBookContentForQuestion2(localInputStreamReader);
    if (localInputStreamReader != null);
    try
    {
      localInputStreamReader.close();
      return localArrayList;
    }
    catch (IOException localIOException)
    {
      localIOException.printStackTrace();
    }
    return localArrayList;
  }

  // ERROR //
  public ArrayList<BookMenuBean> parseSyncTutorialBookMenu(InputStreamReader paramInputStreamReader)
  {
    // Byte code:
    //   0: new 33	java/util/ArrayList
    //   3: dup
    //   4: invokespecial 34	java/util/ArrayList:<init>	()V
    //   7: astore_2
    //   8: new 109	org/jdom/input/SAXBuilder
    //   11: dup
    //   12: invokespecial 110	org/jdom/input/SAXBuilder:<init>	()V
    //   15: astore_3
    //   16: aload_3
    //   17: aload_1
    //   18: invokevirtual 114	org/jdom/input/SAXBuilder:build	(Ljava/io/Reader;)Lorg/jdom/Document;
    //   21: invokevirtual 120	org/jdom/Document:getRootElement	()Lorg/jdom/Element;
    //   24: ldc_w 426
    //   27: invokevirtual 128	org/jdom/Element:getChildren	(Ljava/lang/String;)Ljava/util/List;
    //   30: astore 10
    //   32: aload 10
    //   34: ifnull +32 -> 66
    //   37: aload 10
    //   39: invokeinterface 131 1 0
    //   44: ifne +22 -> 66
    //   47: iconst_0
    //   48: istore 11
    //   50: aload 10
    //   52: invokeinterface 135 1 0
    //   57: istore 12
    //   59: iload 11
    //   61: iload 12
    //   63: if_icmplt +13 -> 76
    //   66: aload_1
    //   67: ifnull +7 -> 74
    //   70: aload_1
    //   71: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   74: aload_2
    //   75: areturn
    //   76: aload 10
    //   78: iload 11
    //   80: invokeinterface 139 2 0
    //   85: checkcast 124	org/jdom/Element
    //   88: astore 13
    //   90: new 36	com/appwoo/txtws/bean/BookMenuBean
    //   93: dup
    //   94: invokespecial 427	com/appwoo/txtws/bean/BookMenuBean:<init>	()V
    //   97: astore 14
    //   99: aload 14
    //   101: iload 11
    //   103: invokevirtual 430	com/appwoo/txtws/bean/BookMenuBean:setId	(I)V
    //   106: aload 14
    //   108: iconst_0
    //   109: invokevirtual 433	com/appwoo/txtws/bean/BookMenuBean:setLevel	(I)V
    //   112: aload 13
    //   114: ldc 190
    //   116: invokevirtual 148	org/jdom/Element:getAttribute	(Ljava/lang/String;)Lorg/jdom/Attribute;
    //   119: astore 15
    //   121: aload 15
    //   123: ifnull +13 -> 136
    //   126: aload 14
    //   128: aload 15
    //   130: invokevirtual 192	org/jdom/Attribute:getValue	()Ljava/lang/String;
    //   133: invokevirtual 436	com/appwoo/txtws/bean/BookMenuBean:setTitle	(Ljava/lang/String;)V
    //   136: aload 13
    //   138: ldc_w 438
    //   141: invokevirtual 148	org/jdom/Element:getAttribute	(Ljava/lang/String;)Lorg/jdom/Attribute;
    //   144: astore 16
    //   146: aload 16
    //   148: ifnull +13 -> 161
    //   151: aload 14
    //   153: aload 16
    //   155: invokevirtual 192	org/jdom/Attribute:getValue	()Ljava/lang/String;
    //   158: invokevirtual 441	com/appwoo/txtws/bean/BookMenuBean:setPath	(Ljava/lang/String;)V
    //   161: aload 13
    //   163: ldc_w 426
    //   166: invokevirtual 128	org/jdom/Element:getChildren	(Ljava/lang/String;)Ljava/util/List;
    //   169: astore 17
    //   171: new 33	java/util/ArrayList
    //   174: dup
    //   175: invokespecial 34	java/util/ArrayList:<init>	()V
    //   178: astore 18
    //   180: aload 17
    //   182: ifnull +28 -> 210
    //   185: aload 17
    //   187: invokeinterface 131 1 0
    //   192: ifne +18 -> 210
    //   195: iconst_0
    //   196: istore 19
    //   198: iload 19
    //   200: aload 17
    //   202: invokeinterface 135 1 0
    //   207: if_icmplt +23 -> 230
    //   210: aload 14
    //   212: aload 18
    //   214: invokevirtual 444	com/appwoo/txtws/bean/BookMenuBean:setMenus	(Ljava/util/ArrayList;)V
    //   217: aload_2
    //   218: aload 14
    //   220: invokevirtual 44	java/util/ArrayList:add	(Ljava/lang/Object;)Z
    //   223: pop
    //   224: iinc 11 1
    //   227: goto -177 -> 50
    //   230: aload 17
    //   232: iload 19
    //   234: invokeinterface 139 2 0
    //   239: checkcast 124	org/jdom/Element
    //   242: astore 21
    //   244: new 36	com/appwoo/txtws/bean/BookMenuBean
    //   247: dup
    //   248: invokespecial 427	com/appwoo/txtws/bean/BookMenuBean:<init>	()V
    //   251: astore 22
    //   253: aload 22
    //   255: iload 19
    //   257: bipush 10
    //   259: iload 11
    //   261: iconst_1
    //   262: iadd
    //   263: imul
    //   264: iadd
    //   265: invokevirtual 430	com/appwoo/txtws/bean/BookMenuBean:setId	(I)V
    //   268: aload 22
    //   270: iconst_1
    //   271: invokevirtual 433	com/appwoo/txtws/bean/BookMenuBean:setLevel	(I)V
    //   274: aload 21
    //   276: ldc 190
    //   278: invokevirtual 148	org/jdom/Element:getAttribute	(Ljava/lang/String;)Lorg/jdom/Attribute;
    //   281: astore 23
    //   283: aload 23
    //   285: ifnull +13 -> 298
    //   288: aload 22
    //   290: aload 23
    //   292: invokevirtual 192	org/jdom/Attribute:getValue	()Ljava/lang/String;
    //   295: invokevirtual 436	com/appwoo/txtws/bean/BookMenuBean:setTitle	(Ljava/lang/String;)V
    //   298: aload 21
    //   300: ldc_w 438
    //   303: invokevirtual 148	org/jdom/Element:getAttribute	(Ljava/lang/String;)Lorg/jdom/Attribute;
    //   306: astore 24
    //   308: aload 24
    //   310: ifnull +13 -> 323
    //   313: aload 22
    //   315: aload 24
    //   317: invokevirtual 192	org/jdom/Attribute:getValue	()Ljava/lang/String;
    //   320: invokevirtual 441	com/appwoo/txtws/bean/BookMenuBean:setPath	(Ljava/lang/String;)V
    //   323: aload 18
    //   325: aload 22
    //   327: invokevirtual 44	java/util/ArrayList:add	(Ljava/lang/Object;)Z
    //   330: pop
    //   331: iinc 19 1
    //   334: goto -136 -> 198
    //   337: astore 8
    //   339: aload 8
    //   341: invokevirtual 198	org/jdom/JDOMException:printStackTrace	()V
    //   344: aload_1
    //   345: ifnull -271 -> 74
    //   348: aload_1
    //   349: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   352: aload_2
    //   353: areturn
    //   354: astore 9
    //   356: aload 9
    //   358: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   361: aload_2
    //   362: areturn
    //   363: astore 6
    //   365: aload 6
    //   367: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   370: aload_1
    //   371: ifnull -297 -> 74
    //   374: aload_1
    //   375: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   378: aload_2
    //   379: areturn
    //   380: astore 7
    //   382: aload 7
    //   384: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   387: aload_2
    //   388: areturn
    //   389: astore 4
    //   391: aload_1
    //   392: ifnull +7 -> 399
    //   395: aload_1
    //   396: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   399: aload 4
    //   401: athrow
    //   402: astore 5
    //   404: aload 5
    //   406: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   409: goto -10 -> 399
    //   412: astore 26
    //   414: aload 26
    //   416: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   419: aload_2
    //   420: areturn
    //
    // Exception table:
    //   from	to	target	type
    //   16	32	337	org/jdom/JDOMException
    //   37	47	337	org/jdom/JDOMException
    //   50	59	337	org/jdom/JDOMException
    //   76	121	337	org/jdom/JDOMException
    //   126	136	337	org/jdom/JDOMException
    //   136	146	337	org/jdom/JDOMException
    //   151	161	337	org/jdom/JDOMException
    //   161	180	337	org/jdom/JDOMException
    //   185	195	337	org/jdom/JDOMException
    //   198	210	337	org/jdom/JDOMException
    //   210	224	337	org/jdom/JDOMException
    //   230	283	337	org/jdom/JDOMException
    //   288	298	337	org/jdom/JDOMException
    //   298	308	337	org/jdom/JDOMException
    //   313	323	337	org/jdom/JDOMException
    //   323	331	337	org/jdom/JDOMException
    //   348	352	354	java/io/IOException
    //   16	32	363	java/io/IOException
    //   37	47	363	java/io/IOException
    //   50	59	363	java/io/IOException
    //   76	121	363	java/io/IOException
    //   126	136	363	java/io/IOException
    //   136	146	363	java/io/IOException
    //   151	161	363	java/io/IOException
    //   161	180	363	java/io/IOException
    //   185	195	363	java/io/IOException
    //   198	210	363	java/io/IOException
    //   210	224	363	java/io/IOException
    //   230	283	363	java/io/IOException
    //   288	298	363	java/io/IOException
    //   298	308	363	java/io/IOException
    //   313	323	363	java/io/IOException
    //   323	331	363	java/io/IOException
    //   374	378	380	java/io/IOException
    //   16	32	389	finally
    //   37	47	389	finally
    //   50	59	389	finally
    //   76	121	389	finally
    //   126	136	389	finally
    //   136	146	389	finally
    //   151	161	389	finally
    //   161	180	389	finally
    //   185	195	389	finally
    //   198	210	389	finally
    //   210	224	389	finally
    //   230	283	389	finally
    //   288	298	389	finally
    //   298	308	389	finally
    //   313	323	389	finally
    //   323	331	389	finally
    //   339	344	389	finally
    //   365	370	389	finally
    //   395	399	402	java/io/IOException
    //   70	74	412	java/io/IOException
  }

  // ERROR //
  public ArrayList<BookModuleBean> parseSyncTutorialBookModule(InputStreamReader paramInputStreamReader)
  {
    // Byte code:
    //   0: new 33	java/util/ArrayList
    //   3: dup
    //   4: invokespecial 34	java/util/ArrayList:<init>	()V
    //   7: astore_2
    //   8: new 109	org/jdom/input/SAXBuilder
    //   11: dup
    //   12: invokespecial 110	org/jdom/input/SAXBuilder:<init>	()V
    //   15: astore_3
    //   16: aload_3
    //   17: aload_1
    //   18: invokevirtual 114	org/jdom/input/SAXBuilder:build	(Ljava/io/Reader;)Lorg/jdom/Document;
    //   21: invokevirtual 120	org/jdom/Document:getRootElement	()Lorg/jdom/Element;
    //   24: ldc 159
    //   26: invokevirtual 128	org/jdom/Element:getChildren	(Ljava/lang/String;)Ljava/util/List;
    //   29: astore 10
    //   31: aload 10
    //   33: ifnull +32 -> 65
    //   36: aload 10
    //   38: invokeinterface 131 1 0
    //   43: ifne +22 -> 65
    //   46: iconst_0
    //   47: istore 11
    //   49: aload 10
    //   51: invokeinterface 135 1 0
    //   56: istore 12
    //   58: iload 11
    //   60: iload 12
    //   62: if_icmplt +13 -> 75
    //   65: aload_1
    //   66: ifnull +7 -> 73
    //   69: aload_1
    //   70: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   73: aload_2
    //   74: areturn
    //   75: aload 10
    //   77: iload 11
    //   79: invokeinterface 139 2 0
    //   84: checkcast 124	org/jdom/Element
    //   87: astore 13
    //   89: new 103	com/appwoo/txtws/bean/BookModuleBean
    //   92: dup
    //   93: invokespecial 445	com/appwoo/txtws/bean/BookModuleBean:<init>	()V
    //   96: astore 14
    //   98: aload 13
    //   100: ldc 190
    //   102: invokevirtual 148	org/jdom/Element:getAttribute	(Ljava/lang/String;)Lorg/jdom/Attribute;
    //   105: astore 15
    //   107: aload 15
    //   109: ifnull +13 -> 122
    //   112: aload 14
    //   114: aload 15
    //   116: invokevirtual 192	org/jdom/Attribute:getValue	()Ljava/lang/String;
    //   119: invokevirtual 448	com/appwoo/txtws/bean/BookModuleBean:setName	(Ljava/lang/String;)V
    //   122: aload 13
    //   124: ldc_w 438
    //   127: invokevirtual 148	org/jdom/Element:getAttribute	(Ljava/lang/String;)Lorg/jdom/Attribute;
    //   130: astore 16
    //   132: aload 16
    //   134: ifnull +13 -> 147
    //   137: aload 14
    //   139: aload 16
    //   141: invokevirtual 192	org/jdom/Attribute:getValue	()Ljava/lang/String;
    //   144: invokevirtual 449	com/appwoo/txtws/bean/BookModuleBean:setPath	(Ljava/lang/String;)V
    //   147: aload 13
    //   149: ldc 144
    //   151: invokevirtual 148	org/jdom/Element:getAttribute	(Ljava/lang/String;)Lorg/jdom/Attribute;
    //   154: astore 17
    //   156: aload 17
    //   158: ifnull +13 -> 171
    //   161: aload 14
    //   163: aload 17
    //   165: invokevirtual 192	org/jdom/Attribute:getValue	()Ljava/lang/String;
    //   168: invokevirtual 451	com/appwoo/txtws/bean/BookModuleBean:setType	(Ljava/lang/String;)V
    //   171: aload_2
    //   172: aload 14
    //   174: invokevirtual 44	java/util/ArrayList:add	(Ljava/lang/Object;)Z
    //   177: pop
    //   178: iinc 11 1
    //   181: goto -132 -> 49
    //   184: astore 8
    //   186: aload 8
    //   188: invokevirtual 198	org/jdom/JDOMException:printStackTrace	()V
    //   191: aload_1
    //   192: ifnull -119 -> 73
    //   195: aload_1
    //   196: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   199: aload_2
    //   200: areturn
    //   201: astore 9
    //   203: aload 9
    //   205: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   208: aload_2
    //   209: areturn
    //   210: astore 6
    //   212: aload 6
    //   214: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   217: aload_1
    //   218: ifnull -145 -> 73
    //   221: aload_1
    //   222: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   225: aload_2
    //   226: areturn
    //   227: astore 7
    //   229: aload 7
    //   231: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   234: aload_2
    //   235: areturn
    //   236: astore 4
    //   238: aload_1
    //   239: ifnull +7 -> 246
    //   242: aload_1
    //   243: invokevirtual 205	java/io/InputStreamReader:close	()V
    //   246: aload 4
    //   248: athrow
    //   249: astore 5
    //   251: aload 5
    //   253: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   256: goto -10 -> 246
    //   259: astore 19
    //   261: aload 19
    //   263: invokevirtual 199	java/io/IOException:printStackTrace	()V
    //   266: aload_2
    //   267: areturn
    //
    // Exception table:
    //   from	to	target	type
    //   16	31	184	org/jdom/JDOMException
    //   36	46	184	org/jdom/JDOMException
    //   49	58	184	org/jdom/JDOMException
    //   75	107	184	org/jdom/JDOMException
    //   112	122	184	org/jdom/JDOMException
    //   122	132	184	org/jdom/JDOMException
    //   137	147	184	org/jdom/JDOMException
    //   147	156	184	org/jdom/JDOMException
    //   161	171	184	org/jdom/JDOMException
    //   171	178	184	org/jdom/JDOMException
    //   195	199	201	java/io/IOException
    //   16	31	210	java/io/IOException
    //   36	46	210	java/io/IOException
    //   49	58	210	java/io/IOException
    //   75	107	210	java/io/IOException
    //   112	122	210	java/io/IOException
    //   122	132	210	java/io/IOException
    //   137	147	210	java/io/IOException
    //   147	156	210	java/io/IOException
    //   161	171	210	java/io/IOException
    //   171	178	210	java/io/IOException
    //   221	225	227	java/io/IOException
    //   16	31	236	finally
    //   36	46	236	finally
    //   49	58	236	finally
    //   75	107	236	finally
    //   112	122	236	finally
    //   122	132	236	finally
    //   137	147	236	finally
    //   147	156	236	finally
    //   161	171	236	finally
    //   171	178	236	finally
    //   186	191	236	finally
    //   212	217	236	finally
    //   242	246	249	java/io/IOException
    //   69	73	259	java/io/IOException
  }
}

/* Location:           C:\Documents and Settings\Administrator\classes_dex2jar.jar
 * Qualified Name:     com.appwoo.txtws.component.BookHelper
 * JD-Core Version:    0.6.2
 */